/*
 * AlarmEventsPanel.java
 *
 * Created on November 1, 2007, 10:46 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author drew
 */

import java.awt.*;
import javax.swing.*;
import java.util.*;


public class AlarmEventsPanel extends JPanel
{
	final static int X_INDENTATION = 10;
	final static int Y_INDENTATION = 10;
	final static int PANEL_WIDTH = 430;
	final static int PANEL_HEIGHT = 85;
	final static int PANEL_SPACING = 10;
	
	Vector<AlarmEvent> events;
	
	/** Creates a new instance of AlarmEventsPanel */
	public AlarmEventsPanel (Vector<AlarmEvent> events)
	{
		this.setLayout (null);
		
		this.events = events;
	}
	
	public void readraw()
	{
		for(int i=0;i<events.size ();i++)
		{
			AlarmEventPanel x = new AlarmEventPanel(events.get (i));
			x.setSize (this.PANEL_WIDTH, this.PANEL_HEIGHT);
			x.setLocation (this.X_INDENTATION,this.Y_INDENTATION+i*(this.PANEL_HEIGHT+this.PANEL_SPACING));
			this.add(x);
		}
		this.setPreferredSize (new Dimension(2*this.X_INDENTATION+this.PANEL_WIDTH, 2*this.Y_INDENTATION+this.events.size ()*(this.PANEL_HEIGHT+this.PANEL_SPACING)));
		this.repaint ();
	}
	
}
